package com.aya.data.decorate.decorateimpl;

import com.aya.data.decorate.IGoods;
import com.aya.data.decorate.impl.Goods;

import java.math.BigDecimal;

public class Substract extends GoodsDecorator {
    public Substract(IGoods goods, BigDecimal price) {
        this.goods = goods;
        this.price = price;
    }

    private IGoods goods;
    private BigDecimal price;

    @Override
    public BigDecimal price() {
        return goods.price().subtract(price);
    }
}
